package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.vo.Comment;
import cn.tedu._04mybatis.pojo.vo.ResultMapVO2;
import cn.tedu._04mybatis.pojo.vo.ResultMapVO3;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CommentMapper {
    @Insert("INSERT INTO comment(content,created,user_id,weibo_id) VALUES (#{content},#{created},#{user_id},#{weibo_id})")
    int insertComment(Comment comment);
    @Delete("DELETE FROM weibo WHERE id=#{Id}")
    int deleteComment(Long Id);
    @Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{user_id} WHERE id=#{id}")
    int updateComment(Comment comment);
    @Select("SELECT id,content,created,user_id FROM weibo WHERE id=#{id}")
    Comment selectCommentById(Long commentId);
    @Select("SELECT id,content,created,user_id FROM weibo WHERE user_id=#{user_id}")
    List<Comment> selectCommentByWeiboId(Long user_id);


}
